<script>

	// 禁用双指放大
	document.documentElement.addEventListener('touchstart', function(event) {
		if (event.touches.length > 1) {
			event.preventDefault();
		}
	}, {
		passive: false
	});

	// 禁用双击放大
	var lastTouchEnd = 0;
	document.documentElement.addEventListener('touchend', function(event) {
		var now = Date.now();
		if (now - lastTouchEnd <= 300) {
			event.preventDefault();
		}
		lastTouchEnd = now;
	}, {
		passive: false
	});
	import pageAnimation from './components/page-animation'
	import routingIntercept from '@/common/permission.js'
	import {
		mapState
	} from 'vuex';
	export default {
		mixins: [pageAnimation],
		computed: {
			...mapState(["hasLogin", "h5Data"])
		},
		methods: {
			setFavicon() {
				if (this.h5Data.siteIcon) {
					var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
					link.type = 'image/x-icon';
					link.rel = 'shortcut icon';
					link.href = (this.pathImg + this.h5Data.siteIcon);
					document.getElementsByTagName('head')[0].appendChild(link);
				}
			},
		},
		onLaunch: function() {
			//获取网站基础信息，logo等.....
			// this.$store.dispatch("setWebInfo");
			// // 对路由进行统一拦截，实现路由导航守卫 router.beforeEach 功能
			// this.setFavicon();
			// let urls = location.hash;
			// console.log(location,'00000',urls)
			// if (urls != "#/pages/login/register" && urls != "#/pages/login/login") {
			// 	uni.reLaunch({
			// 		url: "/pages/login/login"
			// 	});
			// 	return;
			// }
			routingIntercept();
		},
	}
</script>

<style>
	/*每个页面公共css */
	view,
	scroll-view,
	swiper,
	swiper-item,
	cover-view,
	cover-image,
	icon,
	text,
	rich-text,
	progress,
	button,
	checkbox,
	form,
	input,
	label,
	radio,
	slider,
	switch,
	textarea,
	navigator,
	audio,
	camera,
	image,
	video {
		box-sizing: border-box;
	}

	page {
		background-color: #F9F8F8;
	}

	.selectedDetail img {
		width: 100%;
	}

	.rich_pages {
		width: 100% !important;
	}
</style>
